/****************************************************************************************************
 * This method will direct the user to the intended action
 *  path.
 *  Input vars:
 *    action   => the action mapping
 *    meth     => the method name
 *    params   => the parameters to be passed
 *****************************************************************************************************/
function fnForward(action, meth, params)
{  
   var url;
   var prefix = false;
   
   if(appContext)
   {
      url = appContext;
      if(action)
      {
         url += '/' + action;
      }
      else
      {
         alert("'action' not present!");
         return false;
      }
      if(meth)
      {
         if (typeof(Form) != 'undefined' && Form.impl)
         {
            Form.impl.value = meth;
   //       alert('Form has impl :'+Form.impl.value);
         }
         else
         {
            Form = document.baseForm;
            url += '?impl=' +meth;
            prefix = true;
         }
      }
      if(params)
      {
         if (prefix)
         {
            url += '&' +params;
         }
         else
         {
            url += '?' +params;
         }
      }
      Form.action = url;
   // alert('forwarding to =>'+Form.action)
      
      setTimeout('Form.submit()', 50); 
   }
   else
   {
      alert("'appContext' has not been set!");
   }
}

/*
 * Checks and unchecks all checkboxes in a group controlled by a primary
 * checkbox
 * Input vars -
 *    chkName  => the name of the checkboxes in the group
 *    chkObj   => the primary checkbox object
 */
function chkAll(chkName, chkObj) {
   var fields = $(':checkbox').filter(function() {
      if (this.name == chkName)
         this.checked = chkObj.checked;
   });
}